<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//------------------------命名函数--------------------------------------------------------------
			//定义函数
			function add(a, b) {
				var c = a + b;
				return c;
			}

			var d = add(10, 20); //调用函数
			// console.log(d);

			var d1 = add(20, 30); //调用函数
			// console.log(d1);


			function test() {
				console.log("test");
			}
			
		    console.dir(add);

			// test();

			//------------------------匿名函数--------------------------------------------------------------
			var fn1 = function(name, age) {
				return name + age;
			}
			
			 console.dir(fn1);

			// console.log(fn1('zhangsan', 20));
		</script>
	</body>
</html>
